# -*- coding: utf-8 -*-
# @Time    : 2024/8/30 下午2:27
# @Author  : wb
# @Email   : wb@163.com
# @File    : client_page
# @Software: PyCharm

from time import sleep
from pages.wb_base_page import BasePage
from selenium.webdriver.common.by import By


class ClientPoolPage(BasePage):
    url = '/crm'
    # 定位器
    # 获取勾选框元素
    choose_all_locator = (By.CSS_SELECTOR, '#check_all')
    '''获取分配按钮元素'''
    assignment_locator = (By.CSS_SELECTOR, '#form1 > table > tbody > tr:nth-child(1) > td:nth-child(9) > a.fenpei')
    '''获取确定按钮元素'''
    accept_locator = (By.CSS_SELECTOR,'body > div:nth-child(13) > div.ui-dialog-buttonpane.ui-widget-content.ui-helper-clearfix > div > button:nth-child(1)')



    # 浏览器操作
    # 全部勾选
    def click_choose_all(self):
        self.driver.find_element(*self.choose_all_locator).click()
    def click_one_assignment(self):
        # 点击分配
        self.driver.find_element(*self.assignment_locator).click()
        # 点击确认
        self.driver.find_element(*self.accept_locator).click()
        sleep(3)
